<!DOCTYPE html>
<html>

<head>
    <title>a16_SimpleAjax</title>
    <meta charset="utf-8">
    <style>
        .syntax {
            color: red;
        }

        .colorRed {
            color: red;
        }

        .colorGreen {
            color: green;
        }

        .colorBlue {
            color: blue;
        }
    </style>
    <script src="https://localhost/script/jquery-3.5.1.js"></script>
    <script src="https://localhost/script/jquery-ui-1.12.1/jquery-ui.js"></script>

    <script>
        console.log("jQuery version: " + $.fn.jquery);
        console.log("jQuery UI version: " + $.ui.version);

        $(function(){
            setTimeout(function(){
                console.log("timeout.")
                $.get("result.php", {add1:1, add2:3}, function(data){
                    $("#result").html(data);
                    console.log("received ajax response.");
                } )

            }, 1000);
        });
    </script>
</head>

<body>
    
    <code>
    部署说明:
    1)是apache + php
    2)script/目录拷贝到apache的htdocs/
    3)该a15目录拷贝到apache的htdocs/
    </code>

    <h1>1+3 = ?</h1>
    答案是:    
    <div id="result">
        正在努力计算中...
    </div>

</body>

</html>